package com.kaifamiao.store.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.kaifamiao.store.system.domain.User;
import com.kaifamiao.store.system.mapper.UserMapper;
import com.kaifamiao.store.system.service.UserService;
import com.kaifamiao.store.system.util.AesUtil;
import org.springframework.stereotype.Service;

/**
* @author 10854
* @description 针对表【sys_user】的数据库操作Service实现
* @createDate 2023-12-11 10:52:40
*/
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User>
    implements UserService{

    @Override
    public User login(User user) throws Exception {
        // 密码加密
         user.setPassword(AesUtil.AES_CBC_Encrypt_String(user.getPassword()));
        return getBaseMapper().selectByUsernameAndPassword(user.getUsername(), user.getPassword());
    }
}




